mirror of
https://github.com/mum4k/termdash.git
synced 2025-04-28 13:48:51 +08:00
51 lines
1.2 KiB
Go
51 lines
1.2 KiB
Go
// Copyright 2018 Google Inc.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package linechart
|
|
|
|
// options.go contains configurable options for LineChart.
|
|
|
|
// Option is used to provide options to New().
|
|
type Option interface {
|
|
// set sets the provided option.
|
|
set(*options)
|
|
}
|
|
|
|
// options stores the provided options.
|
|
type options struct {
|
|
}
|
|
|
|
// newOptions returns a new options instance.
|
|
func newOptions(opts ...Option) *options {
|
|
opt := &options{}
|
|
for _, o := range opts {
|
|
o.set(opt)
|
|
}
|
|
return opt
|
|
}
|
|
|
|
// option implements Option.
|
|
type option func(*options)
|
|
|
|
// set implements Option.set.
|
|
func (o option) set(opts *options) {
|
|
o(opts)
|
|
}
|
|
|
|
// Foo ...
|
|
func Foo() Option {
|
|
return option(func(opts *options) {
|
|
})
|
|
}
|