Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- type DefaultURLBuilder
- type Eq
- type FilterType
- type Float64
- type In
- type Int
- type Not
- type NotIn
- type Range
- type RangeValue
- type SearchOption
- type SearchType
- type SearchTypes
- type SearchValue
- type SearchValues
- type SortOrder
- type String
- type Time
- type URLBuilder
- type Wildcard
Constants ¶
const ( // And ... And FilterType = "and" // Or ... Or FilterType = "or" // Asc ... Asc SortOrder = "asc" // Desc ... Desc SortOrder = "desc" )
const (
//ContentTypeApplicationJSON application/json mime type
ContentTypeApplicationJSON = "application/json"
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { URLBuilder URLBuilder // contains filtered or unexported fields }
Client contains the base http requirements to make requests to TrueVault
func New ¶
func New(h *http.Client, ub URLBuilder, accessTokenOrKey string) Client
New creates a new Client instance
func NewDefaultClient ¶
NewDefaultClient creates a Client with the default URLBuilder
func (*Client) Do ¶
Do sends an HTTP request and returns an HTTP response, following policy (e.g. redirects, cookies, auth) as configured on the client
func (*Client) NewRequest ¶
func (c *Client) NewRequest(ctx context.Context, method, path, contentType string, body io.Reader) (*http.Request, error)
NewRequest builds an http.Request that contains the Authorization and Content-Type header
func (*Client) WithNewAccessTokenOrKey ¶
WithNewAccessTokenOrKey creates a new Client instance with new Access Token or API key
type DefaultURLBuilder ¶
type DefaultURLBuilder struct{}
DefaultURLBuilder implements URLBuilder interface
func (*DefaultURLBuilder) SearchDocumentURL ¶
func (t *DefaultURLBuilder) SearchDocumentURL(vaultID string) string
SearchDocumentURL ...
type Eq ¶
type Eq struct { Value SearchValue CaseSensitive bool }
Eq ...
func (Eq) MarshalJSON ¶
MarshalJSON returns JSON encoding of Eq
type Float64 ¶
type Float64 struct {
Value float64
}
Float64 implements SearchValue that holds a float64 value
func (Float64) MarshalJSON ¶
MarshalJSON returns JSON encoding of Float64
type In ¶
type In struct { Value []SearchValue CaseSensitive bool }
In ...
func (In) MarshalJSON ¶
MarshalJSON returns JSON encoding of In
type Int ¶
type Int struct {
Value int
}
Int implements SearchValue that holds an int value
func (Int) MarshalJSON ¶
MarshalJSON returns JSON encoding of Int
type Not ¶
type Not struct { Value SearchValue CaseSensitive bool }
Not ...
func (Not) MarshalJSON ¶
MarshalJSON returns JSON encoding of Not
type NotIn ¶
type NotIn struct { Value []SearchValue CaseSensitive bool }
NotIn ...
func (NotIn) MarshalJSON ¶
MarshalJSON returns JSON encoding of NotIn
type Range ¶
type Range struct {
Value RangeValue
}
Range ...
func (Range) MarshalJSON ¶
MarshalJSON returns JSON encoding of Range
type RangeValue ¶
type RangeValue struct { Gt float64 `json:"gt,omitempty"` Gte float64 `json:"gte,omitempty"` Lt float64 `json:"lt,omitempty"` Lte float64 `json:"lte,omitempty"` }
RangeValue implements SearchValue that holds range values
type SearchOption ¶
type SearchOption struct { Filter map[string]SearchType `json:"filter,omitempty"` FilterType FilterType `json:"filter_type,omitempty"` Page int `json:"page,omitempty"` PerPage int `json:"per_page,omitempty"` Sort []map[string]SortOrder `json:"sort,omitempty"` SchemaID uuid.UUID `json:"schema_id,omitempty"` }
SearchOption ...
type SearchType ¶
type SearchType interface {
// contains filtered or unexported methods
}
SearchType ...
type SearchValue ¶
type SearchValue interface {
// contains filtered or unexported methods
}
SearchValue an interface that represents an search value
type String ¶
type String struct {
Value string
}
String implements SearchValue that holds a string value
func (String) MarshalJSON ¶
MarshalJSON returns JSON encoding of String
type Time ¶
Time implements SearchValue that holds an time.Time value
func (Time) MarshalJSON ¶
MarshalJSON returns JSON encoding of Time
type URLBuilder ¶
URLBuilder is the interface for building URLs
type Wildcard ¶
type Wildcard struct { Value SearchValue CaseSensitive bool }
Wildcard ...
func (Wildcard) MarshalJSON ¶
MarshalJSON returns JSON encoding of Wildcard